<!--
 * @Author: zhangjingyu
 * @Date: 2020-10-22 19:29:59
 * @LastEditors: zhangjingyu
 * @LastEditTime: 2021-01-04 16:53:20
 * @FilePath: \vprisk10.14\src\views\PublicManage\publicManage\dimensionManage\dimensionMembers.vue
 * @Description: 维度成员
-->

<template>
  <!-- 维度成员页面 -->
  <div>
    <!-- 操作区域 -->
    <upper-template
      @search="searchForm.pageNo=1,searchFunc()"
      @clear="
        (searchForm.dictCode = ''),
          (searchForm.dictName = ''),
          (searchForm.sourceType = '')
      "
    >
      <!-- 操作按钮区 -->
      <template slot="buttonArea">
        <el-button type="normal" @click="addFunc">新增</el-button>
        <el-button type="normal" @click="editFunc">编辑</el-button>
        <el-button type="normal" @click="deleteFunc">删除</el-button>
        <el-button type="normal" @click="configFun">配置成员</el-button>
        <el-button type="normal" @click="viewConfigFun">查看成员</el-button>
      </template>
      <!-- 搜索区 -->
      <template slot="searchArea">
        <el-form
          :model="searchForm"
          ref="searchForm"
          label-width="80px"
          label-position="right"
          size="mini"
        >
          <el-form-item label="编码：" prop="dictCode">
            <el-input
              v-model.trim="searchForm.dictCode"
              maxlength="40"
              style="width:150px"
            ></el-input>
          </el-form-item>
          <el-form-item label="名称：" prop="dictName">
            <el-input
              v-model="searchForm.dictName"
              maxlength="40"
              style="width:150px"
            ></el-input>
          </el-form-item>
          <el-form-item label="属性：" prop="sourceType">
            <el-select
              v-model="searchForm.sourceType"
              placeholder="请选择"
              style="width:150px"
              clearable=""
            >
              <el-option
                v-for="item in sourceTypeList"
                :key="item.value"
                :value="item.value"
                :label="item.label"
              ></el-option>
            </el-select>
          </el-form-item>
        </el-form>
      </template>
      <!-- 显示隐藏区 -->
      <template slot="columnHide">
        <el-checkbox-group v-model="checkList">
          <el-checkbox
            v-for="item in textData"
            :label="item.label"
            :key="item.prop"
            :disabled="item.hideDisable"
            >{{ item.label }}</el-checkbox
          >
        </el-checkbox-group>
      </template>
    </upper-template>
    <el-table
      ref="multipleTable"
      :data="tableData"
      style="width: 100%"
      @row-click="multipleTableClick"
    >
      <el-table-column
        width="55"
        type="selection"
        
      ></el-table-column>
      <el-table-column
        label="编码"
        prop="dictCode"
        v-if="tablePick[0]"
        show-overflow-tooltip 
      ></el-table-column>
      <el-table-column
        label="名称"
        prop="dictName"
        v-if="tablePick[1]"
          :show-overflow-tooltip="true"
      ></el-table-column>
      <el-table-column
        label="描述"
        prop="descn"
        v-if="tablePick[2]"
          :show-overflow-tooltip="true"
      ></el-table-column>
      <el-table-column label="属性" prop="sourceType" v-if="tablePick[3]">
        <template slot-scope="scope">
          <div style="color:red" v-if="scope.row.sourceType == 'V'">
            {{ $getLabel(scope.row.sourceType, sourceTypeList) }}
          </div>
          <div v-else>
            {{ $getLabel(scope.row.sourceType, sourceTypeList) }}
          </div>
        </template>
      </el-table-column>
      <el-table-column
        label="创建人"
        prop="creator"
        show-overflow-tooltip 
        v-if="tablePick[4]"
        :formatter="r=>r.creator||'-'"
      ></el-table-column>
      <el-table-column label="创建时间" prop="createdTm" v-if="tablePick[5]" show-overflow-tooltip >
        <template slot-scope="scope">
          {{ timeFormat(scope.row.createdTm) }}
        </template>
      </el-table-column>
      <el-table-column
        label="修改人"
        prop="modifier"
        show-overflow-tooltip 
        v-if="tablePick[6]"
        :formatter="r=>r.modifier||'-'"
      ></el-table-column>
      <el-table-column label="修改时间" prop="modifiedTm" v-if="tablePick[7]" show-overflow-tooltip >
        <template slot-scope="scope">
          {{ timeFormat(scope.row.modifiedTm) }}
        </template>
      </el-table-column>
    </el-table>
    <!-- 主表分页 -->
    <pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="searchForm.pageNo"
       :page-size="searchForm.pageSize"
      :pager-count="7"
      @refresh="searchFunc"
      :total="total"
    ></pagination>
    <!-- 新增/编辑弹窗 -->
    <el-dialog
      v-dialogDrag
      :title="saveFlg == '1' ? '新增维度' : '编辑维度'"
      :visible.sync="addOrEdit"
      width="514px"
      top="2%"
    >
      <el-form
        :model="saveForm"
        ref="saveForm"
        label-width="61px"
        label-position="left"
        :rules="saveFormRules"
      >
        <el-form-item label="编码：" prop="dictCode">
          <el-input
            v-model.trim="saveForm.dictCode"
            :disabled="saveFlg != 1"
            placeholder="请输入编码"
            maxlength="40"
          ></el-input>
        </el-form-item>
        <el-form-item label="名称：" prop="dictName">
          <el-input
            v-model.trim="saveForm.dictName"
            placeholder="请输入名称"
            maxlength="15"
          ></el-input>
        </el-form-item>
        <el-form-item label="属性：" prop="sourceType">
          <el-select v-model="saveForm.sourceType" style="width:100%" disabled>
            <el-option
              v-for="item in sourceTypeList"
              :key="item.value"
              :value="item.value"
              :label="item.label"
            ></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="描述：" prop="descn">
          <el-input
            v-model="saveForm.descn"
            type="textarea"
              maxlength="200"
            placeholder="请输入描述"
          ></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="saveFunc">确 定</el-button>
        <el-button @click="addOrEdit = false">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 配置/查看 成员弹窗 -->
    <el-dialog
      v-dialogDrag
      :title="configFlg == 1 ? '配置成员' : '查看成员'"
      :visible.sync="isConfigDialog"
      width="60%"
    >
      <!-- 操作区域 -->
      <upper-template
        @search="searchFormConf.pageNo=1,searchFuncConf()"
        :noIcon="configFlg != 1"
        @clear="
          (searchFormConf.dictItemCode = ''), (searchFormConf.dictItemName = '')
        "
      >
        <!-- 操作按钮区 -->
        <template slot="buttonArea">
          <el-button type="normal" @click="addFuncConf" v-if="configFlg != 2"
            >新增</el-button
          >
          <el-button type="normal" @click="editFuncConf" v-if="configFlg != 2"
            >编辑</el-button
          >
          <el-button type="normal" @click="deleteFuncConf" v-if="configFlg != 2"
            >删除</el-button
          >
          <el-button type="normal" @click="viewFunConf">查看</el-button>
        </template>
        <!-- 搜索区 -->
        <template slot="searchArea">
          <el-form
            :model="searchFormConf"
            ref="searchForm"
            label-width="80px"
            label-position="right"
            size="mini"
          >
            <el-form-item label="编码：" prop="dictCode">
              <el-input
                v-model="searchFormConf.dictItemCode"
                style="width:150px"
                maxlength="40"
              ></el-input>
            </el-form-item>
            <el-form-item label="名称：" prop="dictName">
              <el-input
                v-model="searchFormConf.dictItemName"
                style="width:150px"
                maxlength="15"
              ></el-input>
            </el-form-item>
          </el-form>
        </template>
        <!-- 显示隐藏区 -->
        <template slot="columnHide">
          <el-checkbox-group v-model="checkListConf">
            <el-checkbox
              v-for="item in textDataConf"
              :label="item.label"
              :key="item.prop"
              :disabled="item.hideDisable"
              >{{ item.label }}</el-checkbox
            >
          </el-checkbox-group>
        </template>
      </upper-template>
      <!-- 成员表格展示区 -->
      <el-table
        ref="configTable"
        :data="tableDataConf"
        @row-click="configRowClick"
      >
        <el-table-column
          width="55"
          type="selection"
        ></el-table-column>
        <el-table-column
          label="编码"
          prop="dictItemCode"
          v-if="tablePickConf[0]"
          show-overflow-tooltip 
        ></el-table-column>
        <el-table-column
          label="名称"
          prop="dictItemName"
          show-overflow-tooltip
          v-if="tablePickConf[1]"
        ></el-table-column>
        <el-table-column
          label="是否叶子节点"
          prop="isLeaf"
          v-if="tablePickConf[2]"
        >
          <template slot-scope="scope">
            <div style="color:red" v-if="scope.row.isLeaf == '0'">
              {{ $getLabel(scope.row.isLeaf, isLeafList) }}
            </div>
            <div v-else>
              {{ $getLabel(scope.row.isLeaf, isLeafList) }}
            </div>
          </template>
        </el-table-column>
        <el-table-column
          label="描述"
          prop="descn"
          show-overflow-tooltip
          v-if="tablePickConf[3]"
        ></el-table-column>
        <el-table-column
          label="创建人"
          prop="creator"
          v-if="tablePickConf[4]"
        :formatter="r=>r.creator||'-'"
        ></el-table-column>
        <el-table-column
          label="创建时间"
          prop="createdTm"
          show-overflow-tooltip
          v-if="tablePickConf[5]"
        >
          <template slot-scope="scope">
            {{ timeFormat(scope.row.createdTm) }}
          </template>
        </el-table-column>
        <el-table-column
          label="修改人"
          prop="modifier"
          v-if="tablePickConf[6]"
        :formatter="r=>r.modifier||'-'"
        ></el-table-column>
        <el-table-column
          label="修改时间"
          prop="modifiedTm"
          show-overflow-tooltip
          v-if="tablePickConf[7]"
        >
          <template slot-scope="scope">
            {{ timeFormat(scope.row.modifiedTm) }}
          </template>
        </el-table-column>
      </el-table>
      <!-- 成员表分页 -->
      <pagination
        @size-change="handleSizeChangeConf"
        @current-change="handleCurrentChangeConf"
        :current-page="searchFormConf.pageNo"
         :page-size="searchFormConf.pageSize"
        @refresh = "searchFuncConf"
        :pager-count="7"
        :total="totalConf"
      ></pagination>
      <div slot="footer" class="dialog-footer">
        <!-- 空 -->
      </div>

      <!-- 配置成员弹窗中新增/编辑/查看弹窗 -->
      <el-dialog
        v-dialogDrag
        :title="
          saveConfFlg == 1
            ? '新增成员'
            : saveConfFlg == 2
            ? '编辑成员'
            : '查看成员'
        "
        :visible.sync="addOrEditConf"
        width="514px"
        append-to-body
      >
        <el-form
          :model="saveFormConf"
          ref="saveFormConf"
          label-width="97px"
          label-position="left"
          :rules="saveFormConfRules"
          :disabled="saveConfFlg == 3"
        >
          <el-form-item label="编码：" prop="dictItemCode">
            <el-input
              v-model="saveFormConf.dictItemCode"
              :disabled="saveConfFlg != 1"
              maxlength="25"
              placeholder="请输入编码"
            ></el-input>
          </el-form-item>
          <el-form-item label="名称：" prop="dictItemName">
            <el-input
              v-model="saveFormConf.dictItemName"
              placeholder="请输入名称"
              maxlength="13"
            ></el-input>
          </el-form-item>
          <el-form-item label="是否叶子：" prop="isLeaf">
            <el-select v-model="saveFormConf.isLeaf" style="width:100%">
              <el-option
                v-for="item in isLeafList"
                :key="item.value"
                :value="item.value"
                :label="item.label"
              ></el-option>
            </el-select>
          </el-form-item>
          <el-form-item label="描述：" prop="descn">
            <el-input
              v-model="saveFormConf.descn"
              type="textarea"
              placeholder="请输入描述"
              maxlength="200"
            ></el-input>
          </el-form-item>
        </el-form>
        <div slot="footer" class="dialog-footer">
          <el-button @click="saveFuncConf" v-if="saveConfFlg != 3"
            >确认</el-button
          >
          <el-button @click="addOrEditConf = false" v-if="saveConfFlg != 3"
            >取消</el-button
          >
          <el-button @click="addOrEditConf = false" v-if="saveConfFlg == 3"
            >关闭</el-button
          >
        </div>
      </el-dialog>
    </el-dialog>
  </div>
</template>

<script>
import moment from "moment";
import { publicManage_pub } from "@/api/index";
export default {
  data() {
    return {
      addOrEdit: false, // 新增/编辑弹窗
      saveFlg: 1, // 1新增 2 编辑
      sourceTypeList: [
        { value: "U", label: "用户定义" },
        { value: "V", label: "系统内置" }
      ],
      searchForm: {
        pageNo: 1,
        pageSize: 15,
        dictCode: '',
        dictName: '',
        sourceType: ''
      },
      total: 0,
      // 主表列显示隐藏依据
      textData: [
        { prop: "dictCode", label: "编码", hideDisable: true },
        { prop: "dictName", label: "名称", hideDisable: true },
        { prop: "descn", label: "描述", hideDisable: true },
        { prop: "sourceType", label: "属性", hideDisable: true },
        { prop: "creator", label: "创建人" },
        { prop: "createdTm", label: "创建时间" },
        { prop: "modifier", label: "修改人" },
        { prop: "modifiedTm", label: "修改时间" }
      ],
      checkList: [
        "编码",
        "名称",
        "描述",
        "属性",
        "创建人",
        "创建时间",
        "修改人",
        "修改时间"
      ],
      // 主表数据
      tableData: [],
      saveForm: {},
      saveFormRules: {
        dictCode: [
          { required: true, message: "请输入编码", trigger: "blur" },
          {
            pattern: /^[0-9a-zA-Z_]{0,25}$/,
            message: "请输入1-25位数字、字母或下划线",
            trigger: "blur"
          },
          { validator: this.dictCodeValid, trigger: "blur" }
        ],
        dictName: [
          { required: true, message: "请输入名称", trigger: "blur" },
          { validator: this.dictNameValid, trigger: "change" }
        ],
        sourceType: [{ required: true, message: "请选择属性", trigger: "blur" }]
      },
      saveFormConfRules: {
        dictItemCode: [
          { required: true, message: "请输入编码", trigger: "blur" },
          {
            pattern: /^[0-9a-zA-Z_]{0,25}$/,
            message: "请输入1-25位数字、字母或下划线",
            trigger: "blur"
          },
          { validator: this.dictItemCodeValid, trigger: "blur" }
        ],
        dictItemName: [
          { required: true, message: "请输入名称", trigger: "blur" },
          { validator: this.dictItemNameValid, trigger: "blur" }
        ],
        isLeaf: [{ required: true, message: "请选择是否叶子", trigger: "blur" }]
      },
      //   -----------------------------------------------------配置成员/查看成员 内的data-------------------------
      configFlg: 1, //1配置成员 2 查看成员
      isConfigDialog: false,
      searchFormConf: {
        dictItemCode:"",
        dictItemName:"",
        pageNo: 1,
        pageSize: 15
      },
      totalConf: 0,
      checkListConf: [
        "编码",
        "名称",
        "是否叶子节点",
        "描述",
        "创建人",
        "创建时间",
        "修改人",
        "修改时间"
      ],
      // 成员表列显示隐藏依据
      textDataConf: [
        { prop: "dictItemCode", label: "编码", hideDisable: true },
        { prop: "dictItemName", label: "名称", hideDisable: true },
        { prop: "isLeaf", label: "是否叶子节点", hideDisable: true }, // 0否 1是
        { prop: "descn", label: "描述" },
        { prop: "creator", label: "创建人" },
        { prop: "createdTm", label: "创建时间" },
        { prop: "modifier", label: "修改人" },
        { prop: "modifiedTm", label: "修改时间" }
      ],
      isLeafList: [
        { value: "1", label: "是" },
        { value: "0", label: "否" }
      ],
      tableDataConf: [],
      saveConfFlg: 1, //1新增成员 2编辑成员 3查看成员
      addOrEditConf: false, // 控制配置成员内新增/编辑/查看弹窗
      saveFormConf: {
        dictItemCode: "",
        dictItemName: "",
        dictCode: "",
        descn: "",
        isLeaf: ""
      }
    };
  },
  created() {
    this.searchFunc();
  },

  computed: {
    tablePick() {
      return this.$tableDataPick(this.checkList, this.textData);
    },
    tablePickConf() {
      return this.$tableDataPick(this.checkListConf, this.textDataConf);
    }
  },
  watch:{
      addOrEdit() {
      // 窗口打开或关闭清除校验结果
      if (this.$refs.saveForm) {
        this.$refs.saveForm.clearValidate();
      }
    },
      addOrEditConf() {
      // 窗口打开或关闭清除校验结果
      if (this.$refs.saveFormConf) {
        this.$refs.saveFormConf.clearValidate();
      }
    },
  },
  methods: {
    // 编号是否重复校验
    dictCodeValid(rule, value, callback) {
      // 只在新增时校验
      if (this.saveFlg != 1) {
        callback();
        return;
      }
      publicManage_pub.dimensionCheckDictCode({ dictCode: value }).then(res => {
        if (res.code == 200) {
          callback();
        } else {
          callback(new Error("编号已存在"));
        }
      });
    },

    // 名称是否重复校验
    dictNameValid(rule, value, callback) {
      publicManage_pub
        .dimensionCheckDictName({
          dictCode: this.saveForm.dictCode,
          dictName: value
        })
        .then(res => {
          if (res.code == 200) {
            callback();
          } else {
            callback(new Error("名称已存在"));
          }
        });
    },
    // item编号是否重复校验
    dictItemCodeValid(rule, value, callback) {
      // 只在新增时校验
      if (this.saveConfFlg != 1) {
        callback();
        return;
      }
      publicManage_pub
        .dimensionCheckDictitemCode({
          dictCode: this.saveFormConf.dictCode,
          dictItemCode: value
        })
        .then(res => {
          if (res.code == 200) {
            callback();
          } else {
            callback(new Error("编号已存在"));
          }
        });
    },
    // item名称是否重复校验
    dictItemNameValid(rule, value, callback) {
      publicManage_pub
        .dimensionCheckDictitemName({
          dictCode: this.saveFormConf.dictCode,
          dictItemCode: this.saveFormConf.dictItemCode,
          dictItemName: value
        })
        .then(res => {
          if (res.code == 200) {
            callback();
          } else {
            callback(new Error("名称已存在"));
          }
        });
    },
    //主表查询
    searchFunc() {
      publicManage_pub.dimensionQuery(this.searchForm).then(res => {
        console.log(res, "===");
        this.tableData = res.data;
        this.total = res.count;
      });
    },
    // 主表新增
    addFunc() {
      this.saveFlg = 1;
      for (let k in this.saveForm) {
        this.saveForm[k] = "";
      }
      this.saveForm.sourceType = "U";
      this.addOrEdit = true;
  
             
    },
    // 主表编辑
    editFunc() {
      this.saveFlg = 2;
      let selection = this.$refs.multipleTable.selection;
      if (selection.length != 1) {
        return this.$message.warning("请选择一条数据进行修改");
      }
      let row = selection[0];
      this.saveForm = { ...row };
      this.addOrEdit = true;
    },
    // 保存
    saveFunc() {
      this.$refs["saveForm"].validate(valid => {
        if (valid) {
          let data = {
            ...this.saveForm
          };
          publicManage_pub.dimensionSave(data).then(res => {
            if (res.code == 200) {
              this.$message.success("保存成功");
              this.addOrEdit = false;
              this.searchFunc();
            }
          });
        }
      });
    },
    // 主表删除
    deleteFunc() {
      let selection = this.$refs.multipleTable.selection;
      if (selection.length < 1) {
        return this.$message.warning("请选择要删除的数据");
      }
      this.$confirm("您确认要删除吗？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          let flg = true;
          for (let i = 0; i < selection.length; i++) {
            let element = selection[i];
            if(element.sourceType == 'V'){
              flg = false; break;
            }
          }
          console.log(selection,flg)
          if(flg===false) return this.$message.warning("系统内置维度不可删除")
          let data = { ids: selection.map(v => v.dictCode).toString() };
          publicManage_pub.dimensionDelete(data).then(res => {
            if (res.code == 200) {
              this.$message.success("删除成功");
              this.searchFunc();
            }else{
              this.$message.error(res.message||'删除失败')
            }
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除"
          });
        });
    },
    // 配置成员
    configFun() {
      this.configFlg = 1;
      let selection = this.$refs.multipleTable.selection;
      if (selection.length < 1) {
        return this.$message.warning("请选择一条数据");
      } else if (selection.length > 1) {
        return this.$message.warning("只能选择一条数据");
      } else {
        this.isConfigDialog = true;
        this.searchFormConf.dictCode = selection[0].dictCode;
        this.saveFormConf.dictCode = selection[0].dictCode;
        console.log(this.searchFormConf.dictCode);
        this.searchFuncConf();
      }
    },
    // 查看成员
    viewConfigFun() {
      this.configFlg = 2;
      let selection = this.$refs.multipleTable.selection;
      if (selection.length < 1) {
        return this.$message.warning("请选择一条数据");
      } else if (selection.length > 1) {
        return this.$message.warning("只能选择一条数据");
      } else {
        this.isConfigDialog = true;
        this.searchFormConf.dictCode = selection[0].dictCode;
        this.saveFormConf.dictCode = selection[0].dictCode;
        this.searchFuncConf();
      }
    },
    // 成员表查询
    searchFuncConf() {
      let data = this.searchFormConf;
      publicManage_pub.dimensionMemberQuery(data).then(res => {
        if (res.code == 200) {
          this.tableDataConf = res.data;
          this.totalConf = res.count;
        }
      });
    },
    // 成员表新增
    addFuncConf() {
      this.saveConfFlg = 1;
      this.saveFormConf.descn = "";
      this.saveFormConf.dictItemCode = "";
      this.saveFormConf.dictItemName = "";
      this.saveFormConf.dictItemId = "";
      this.saveFormConf.isLeaf = "";
      this.addOrEditConf = true;

    },
    // 成员表编辑
    editFuncConf() {
      this.saveConfFlg = 2;
      let selection = this.$refs.configTable.selection;
      if (selection.length != 1) {
        return this.$message.warning("请选择一条数据进行修改");
      }
      let row = selection[0];
      this.saveFormConf.dictItemId = row.dictItemId;
      this.saveFormConf.dictItemCode = row.dictItemCode;
      this.saveFormConf.dictItemName = row.dictItemName;
      this.saveFormConf.isLeaf = row.isLeaf;
      this.saveFormConf.descn = row.descn;
      this.addOrEditConf = true;
    },
    saveFuncConf() {
      this.$refs["saveFormConf"].validate(valid => {
        if (valid) {
          let data = {
            ...this.saveFormConf
          };
          publicManage_pub.dimensionMemberSave(data).then(res => {
            if (res.code == 200) {
              this.$message.success("保存成功");
              this.addOrEditConf = false;
              this.searchFuncConf();
            } else {
              this.$message.error(res.message || res.msg || "保存失败");
            }
          });
        }
      });
    },
    // 成员表查看按钮
    viewFunConf() {
      this.saveConfFlg = 3;
      let selection = this.$refs.configTable.selection;
      if (selection.length != 1) {
        return this.$message.warning("请选择一条数据");
      }
      let row = selection[0];
      this.saveFormConf = { ...row };
      this.addOrEditConf = true;
    },
    // 成员表删除
    deleteFuncConf() {
      let selection = this.$refs.configTable.selection;
      if (selection.length < 1) {
        return this.$message.warning("请选择要删除的数据");
      }
      this.$confirm("您确认要删除吗？", "提示", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          let data = {
            ids: selection.map(v => v.dictItemId).toString(),
            dictCode: this.searchFormConf.dictCode
          };
          publicManage_pub.removeDimensionMember(data).then(res => {
            if (res.code == 200) {
              this.$message.success("删除成功");
              this.searchFuncConf();
            } else {
              this.$message.error(res.message || "删除失败");
            }
          });
        })
        .catch(() => {
          this.$message({
            type: "info",
            message: "已取消删除"
          });
        });
    },
    handleSizeChange(val) {
      this.searchForm.pageSize = val;
      this.searchFunc();
    },
    handleCurrentChange(val) {
      this.searchForm.pageNo = val;
      this.searchFunc();
      console.log(`当前页: ${val}`);
    },
    handleSizeChangeConf(val) {
      this.searchFormConf.pageSize = val;
      this.searchFuncConf();
    },
    handleCurrentChangeConf(val) {
      this.searchFormConf.pageNo = val;
      console.log(`当前页: ${val}`);
      this.searchFuncConf();
    },
    multipleTableClick(row) {
      this.$refs.multipleTable.clearSelection();
      this.$refs.multipleTable.toggleRowSelection(row, true);
    },
    configRowClick(row) {
      this.$refs.configTable.clearSelection();
      this.$refs.configTable.toggleRowSelection(row, true);
    },
    timeFormat(val) {
      return val ? moment(val).format("YYYY-MM-DD HH:mm:ss") : "-";
    }
  }
};
</script>

<style lang="scss" scoped>
</style>